//
//  GoOutAcePackDetailCoverCell.m
//  ArtOfLiving
//
//  Created by 刘虎 on 16/5/5.
//  Copyright © 2016年 刘虎. All rights reserved.
//

#import "GoOutAcePackDetailCoverCell.h"
#import "GoOutAcePackDetailModel.h"

@interface GoOutAcePackDetailCoverCell ()

@property (weak, nonatomic) IBOutlet UIImageView *coverImageView;
@property (weak, nonatomic) IBOutlet UILabel *downloadLabel;
@property (weak, nonatomic) IBOutlet UILabel *guideDesLabel;
@property (weak, nonatomic) IBOutlet UIView *progressView;

@end

@implementation GoOutAcePackDetailCoverCell


- (void)awakeFromNib {
    
    self.downloadLabel.userInteractionEnabled = YES;
    self.downloadLabel.layer.cornerRadius = 20;
    self.downloadLabel.layer.masksToBounds = YES;
    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(downloadTapAction:)];
    [self.downloadLabel addGestureRecognizer:tapGesture];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (void)downloadTapAction:(UITapGestureRecognizer *)sender {
    
    NSLog(@"下载");
}

- (void)setCellWithModel:(id)model {
    
    GoOutAcePackDetailModel *detailModel = model;
    SDWebImageOptions options = SDWebImageRetryFailed | SDWebImageLowPriority;
    [self.coverImageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/670_420.jpg?cover_updatetime=%@", detailModel.cover, detailModel.create_time]] placeholderImage:[UIImage imageNamed:@"travelPlaceholder.png"] options:options];
    self.guideDesLabel.text = detailModel.info;
}

@end
